<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@page import="com.ks.app.admin.hibernate.KsVersion"%>
<%@ include file="/commons/taglibs.jsp" %>
<html>
  <head>
      <title>版本管理</title>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />      
      <link href="${js}/thickbox.css" rel="stylesheet" type="text/css" />
      <script src="${js}/jqui/jquery-1.2.6.min.js" type="text/javascript"></script>
      <script src="${js}/jqtool.js" type="text/javascript"></script>
      <script src="${js}/ui.js" type="text/javascript"></script>
      <script src="${js}/thickbox-compressed.js" type="text/javascript"></script>
      <link href="${css}/Public.css"type="text/css" rel="stylesheet" />
      <link href="${css}/PublicEdit.css"type="text/css" rel="stylesheet" />      
      <script language="javascript" src="${js}/dateselect.js"></script>
      <style type="text/css">
<!--
.STYLE1 {font-size: 12px}
.STYLE3 {font-size: 12px; font-weight: bold; }
.STYLE4 {	color: #03515d;
	font-size: 12px;
}
.dleft{
  width:60px;
  border:#FF0000 1px solid;
}
.dright{
  width:100px;
  border:green 1px solid;
}
.sortHead{
    background-image: url(${images}/updown.gif);
	background-repeat: no-repeat;
	background-position: center right;
	cursor: pointer;
}
.sortUp{
    background-image: url(${images}/desc.gif);
	background-repeat: no-repeat;
	background-position: center right;
	cursor: pointer;
}
.sortDown{
    background-image: url(${images}/asc.gif);
	background-repeat: no-repeat;
	background-position: center right;
	cursor: pointer;
}

#viewbox {
		position: absolute;
		left:320px;
		width: 450px;
		margin: 10px;
		padding: 20px 20px 20px;
		background: #eee;
		border: 2px solid #42CBDC;
}
-->
      </style>
      <script language="javascript">
	      $(window).bind('load', changeAct);
	       function changeAct() {
	           $("#pno").change( function(){ 
		                            if( !isnumeric($("#pno"),"必须输入数字") ){
									    $("#pno").val("");
									    return;
									}
									if ( $("#pno").val() < 1 ){
									    alert("页码必须大于0");
										$("#pno").val("");
										$("#pno").focus();
										return;
									}
								 });
         }
         
		 function toPage(){
		     if( $("#pno").val() == "" ){
			     alert("请输入页码");
				 $("#pno").focus();
				 return;
			 }			 
			 window.location.href = " ks_version_grid?pos=1&status=${kv.status}&vtype=${kv.vtype}&pno="+$("#pno").val();
		 }	
		 
		 function delcfm()
			{
			    if(!confirm("确认要删除？"))
			    {
			        window.event.returnValue = false;
			    }
			}
			
		function ToAddCmd()
		{				
			window.location.href = "addApk";
		}	    
	  </script>
</head>
  <body marginheight="0">
    <%
				            KsVersion a = (KsVersion)request.getAttribute("kv"); 
				            int status = 0;
				            int vtype  = 0;
				            if(a != null){
				            	status = a.getStatus();
				            	vtype  = a.getVtype();
				            }             
	%>
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td height="30" background="${images}/tab_05.gif">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="12" height="30"><img src="${images}/tab_03.gif" width="12" height="30" /></td>
            <td>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="46%" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="5%"><div align="center"><img src="${images}/tb.gif" width="16" height="16" /></div></td>
                        <td width="95%" class="STYLE1"><span class="STYLE3">版本管理</span></td>
                      </tr>
                  </table></td><td width="54%" align="right">
                   <input type="button" onclick="ToAddCmd()" class="button2_60" name="addcmd" value="新增APK"/>
                  </td>
            </tr>
            </table>            
            </td>
            <td width="16"><img src="${images}/tab_07.gif" width="16" height="30" /></td>
          </tr>
      </table>      
      </td>
    </tr>
    <tr>
      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
            <td width="8" background="${images}/tab_12.gif">&nbsp;</td>
            <td>
           <table width="100%" border="0" cellspacing="0" cellpadding="0">
                 <tr>
	                  <td valign="middle" class="STYLE1">
			                    <form name="qr" action="ks_version_grid" method="post">   
					                 <div class="l_f_body_row">
					                        <div class="l_f_body_div1">版本类别：</div>
					                        <div class="l_f_body_div5" >			                        
							                    <input type="radio" name="vtype"  value="1" <%=(vtype==1)?"checked='checked'":"" %>/> apk
							                    <input type="radio" name="vtype"  value="2" <%=(vtype==2)?"checked='checked'":"" %>/> 站点导航 
							                    <input type="radio" name="vtype"  value="3" <%=(vtype==3)?"checked='checked'":"" %>/> 广告墙
				    							<input type="radio" name="vtype"  value="0" <%=(vtype==0)?"checked='checked'":"" %>/> 全部             		                   		      
							                </div>                      
					                 </div>		
					                 <div class="l_f_body_row">
					                        <div class="l_f_body_div1">上线状态：</div>
					                        <div class="l_f_body_div5" >			                        
							                    <input type="radio" name="status"  value="2" <%=(status==2)?"checked='checked'":"" %>/> 上线
							                    <input type="radio" name="status"  value="1" <%=(status==1)?"checked='checked'":"" %>/> 下线     							
				    							<input type="radio" name="status"  value="0" <%=(status==0)?"checked='checked'":"" %>/> 全部             		                   		      
							                </div>                      
					                 </div>							        		               		                 
					                 <div class="center l_f_body_foot">	
			                    	   <input type="submit" name="button"  style="border:solid 1px #ddf1fd;width:50;filter:progid:DXImageTransform.microsoft.gradient(startColorStr=#ddf1fd,endColorStr=#ddf1fd)" "   value="查询">                   	                	  
			                         </div>
			                  </form>
	                  </td>
	              </tr>
            </table>
			        <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6" id="sort_table" >
			   			<tr id="sort_head">
			        				   	      			    
			            		<td height="22" background="${images}/bg.gif" bgcolor="#FFFFFF"><div align="center" ><span class="STYLE1">版本类别</span></div></td>
								<td height="22" background="${images}/bg.gif" bgcolor="#FFFFFF"><div align="center" ><span class="STYLE1">分辨率</span></div></td>					
			            		<td height="22" background="${images}/bg.gif" width="40%" bgcolor="#FFFFFF"><div align="center" id="cb_wfc"><span class="STYLE1">下载地址</span></div></td>			            	
			            		<td height="22" background="${images}/bg.gif" bgcolor="#FFFFFF"><div align="center" ><span class="STYLE1">版本号</span></div></td>						
								<td height="22" background="${images}/bg.gif" bgcolor="#FFFFFF"><div align="center" ><span class="STYLE1">版本状态</span></div></td>
								<td height="22" background="${images}/bg.gif" bgcolor="#FFFFFF"><div align="center" ><span class="STYLE1">上线时间</span></div></td>
														 	  
								<td height="22" background="${images}/bg.gif" bgcolor="#FFFFFF"><div align="center" ><span class="STYLE1">删除</span></div></td>
						</tr> 
						
			            <c:forEach items="${list}" var="ver">
			                <tr> 			     			                	 
				  				  <td height="22" bgcolor="#FFFFFF"><div align="center" ><span class="STYLE1">				  				 									    							 						
														<c:if test="${ver.vtype==1}">apk</c:if>	
														<c:if test="${ver.vtype==2}">站点导航</c:if>	
														<c:if test="${ver.vtype==3}">广告墙</c:if>	
				  				  </span></div></td>   
				  				  <td height="22" bgcolor="#FFFFFF"><div align="center" ><span class="STYLE1">${ver.resolution}</span></div></td>
				  				  <td height="22" bgcolor="#FFFFFF"><div align="center" ><span class="STYLE1">${ver.filepath}</span></div></td> 
				  				  <td height="22" bgcolor="#FFFFFF"><div align="center" ><span class="STYLE1">${ver.version}</span></div></td> 
			  					   
			  					  <td height="22" bgcolor="#FFFFFF"><div align="center" ><span class="STYLE1">
			  					   		<c:if test="${ver.status==1}">下线</c:if>
		          						<c:if test="${ver.status==2}">上线</c:if></span></div>
			  					  </td>  
			  					  <td height="22" bgcolor="#FFFFFF"><div align="center" ><span class="STYLE1">${ver.createtime}</span></div></td>  			  							  								               			  								              			  					                
 								  <td height="22" bgcolor="#FFFFFF"><div align="center" id="cb_Delete"><a href="ks_del_version?id=${ver.id}&pno=${PAGER.curPage}&pos=1&status=${kv.status}&vtype=${kv.vtype}" onclick="delcfm()"><span class="STYLE1">删除</span></a></div></td>  
							</tr>
			           </c:forEach>
			         </table>
          </td>
            <td width="8" background="${images}/tab_15.gif">&nbsp;</td>
          </tr>
      </table></td>
    </tr>
    <tr>
      <td height="35" background="${images}/tab_19.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="12" height="35"><img src="${images}/tab_18.gif" width="12" height="35" /></td>
            <td>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
               <tr>
                   <td class="STYLE4">&nbsp;&nbsp;共有 ${PAGER.totoalCnt} 条记录，当前第 ${PAGER.curPage}/${PAGER.totoalPage} 页</td>
                  <td><table border="0" align="right" cellpadding="0" cellspacing="0">
                      <tr>       
                        <td width="40"><a href="ks_version_grid?pos=1&status=${kv.status}&vtype=${kv.vtype}"><img src="${images}/first.gif" width="37" height="15" border="0" /></a></td>
                        <td width="45"><a href="ks_version_grid?pos=1&status=${kv.status}&vtype=${kv.vtype}&pno=${PAGER.prePage}"><img src="${images}/back.gif" width="43" height="15" border="0" /></a></td>
                        <td width="45"><a href="ks_version_grid?pos=1&status=${kv.status}&vtype=${kv.vtype}&pno=${PAGER.nextPage}"><img src="${images}/next.gif" width="43" height="15" border="0" /></a></td>
                        <td width="40"><a href="ks_version_grid?pos=1&status=${kv.status}&vtype=${kv.vtype}&pno=${PAGER.totoalPage}"><img src="${images}/last.gif" width="37" height="15" border="0" /></a></td>
                        <td width="100"><div align="center"><span class="STYLE1">转到第
                          <input name="pno" id="pno" type="text" size="4" style="height:16px; width:20px; border:1px solid #999999;" />
                          页 </span></div></td>
                        <td width="40"><img src="${images}/go.gif" width="37" height="15"  style="cursor:hand" onClick="toPage()" border="0"/></td>
                      </tr>
                  </table></td>
                </tr>
            </table></td>
            <td width="16"><img src="${images}/tab_20.gif" width="16" height="35" /></td>
          </tr>
      </table>
      </td>
    </tr>
  </table>
</body>
</html>
